﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucProcducts.ascx.cs" Inherits="Client_UserControl_ucProcducts" %>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
        <td>
            <table border="0" cellpadding="0" cellspacing="0">
                <asp:ListView runat="server" ID="lvItems" ItemPlaceholderID="groupPlaceholder" GroupItemCount="3"
                    GroupPlaceholderID="layoutTemplate" >
                    <LayoutTemplate>
                        <table id="layoutTemplate" runat="server" border="0" cellpadding="0" cellspacing="0">
                        </table>
                    </LayoutTemplate>
                    <GroupTemplate>
                        <tr>
                            <div id="groupPlaceholder" runat="server">
                            </div>
                        </tr>
                    </GroupTemplate>
                    <ItemTemplate>
                        <td style="padding: 0 0 15px 15px;">
                            <asp:HyperLink ID="lnkItemDetails" runat="server" NavigateUrl=''>
                                <div class="productItemStyle" onmouseover="javascript:this.style.background='#e5f4ff';this.style.border='solid 1px #3399cc';"
                                    onmouseout="javascript:this.style.background='#FFFFFF';this.style.border='solid 1px #cccccc';this.style.color='#353f45';"
                                    price='<%# Eval("BaseSellingPrice") %>' matchedprice='0' code='<%# Eval("ItemID") %>'>
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                        <tr>
                                            <td align="center" style="padding: 5px">
                                                <table width="100%" border="0" cellspacing="0" cellpadding="5">
                                                    <tr>
                                                        <td>
                                                          <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# "~/Client/ItemDetail.aspx?id=" + Eval("ItemID") + "&keepThis=true&TB_iframe=true&width=800&height=500" %>'
                                                                CssClass="thickbox" ToolTip="ITEM DETAILS">
                                                            <asp:Image ID="img" runat="server" ImageUrl='<%# "~/ImageProcess.ashx?file=" + "~/Admin/images/items/" + Eval("ImageURL") + "&width=100&heigh=100&dd=true" %>'
                                                                AlternateText="No Image" /></asp:HyperLink>
                                                        </td>
                                                        <td>
                                                            <p style="height: 45px">
                                                                
                                                                    <%# Eval("ItemNumber") %>
                                                                    <br />
                                                                    <%# Eval("ItemName") %>
                                                               
                                                            </p>
                                                            <p>
                                                                <span class="clsPrice">
                                                                    <%# DataBinder.Eval(Container.DataItem, "BaseSellingPrice", "{0:C}") %></span></p>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="center">
                                                <table border="0" cellspacing="3" cellpadding="0">
                                                    <tr>
                                                        <td width="1" class="imglink">
                                                            <asp:HyperLink ID="lnk" runat="server" NavigateUrl='<%# "~/Client/ItemDetail.aspx?id=" + Eval("ItemID") + "&keepThis=true&TB_iframe=true&width=800&height=500" %>'
                                                                CssClass="thickbox" ToolTip="ITEM DETAILS">
                                                                <asp:Image ID="ImageButton1" runat="server" Width="76" Height="27" ImageUrl="~/Client/images/bt_detail.png"
                                                                    AlternateText="No Image" ToolTip="View Item Details" /></asp:HyperLink>
                                                        </td>
                                                        <td>
                                                            &nbsp;
                                                        </td>
                                                        <td width="1" class="imglink">
                                                            <asp:HyperLink ID="HyperLink2" runat="server" ToolTip="Add To Cart">
                                                                <%--<asp:Image ID="Image1" runat="server" ImageUrl="~/Client/images/bt_addtocart.png" onclick='<%#string.Format("fn_AddToCart(\"{0}|{1}|{2}\")", Eval("ItemID").ToString(), Eval("BaseSellingPrice").ToString(),"0")%>' />--%>
                                                                <asp:Image ID="Image1" runat="server" ImageUrl="~/Client/images/bt_addtocart2.png" onclick='<%#string.Format("fn_AddToCart(\"{0}|{1}|{2}\")", Eval("ItemID").ToString(), Eval("BaseSellingPrice").ToString(),"0")%>' />
                                                            </asp:HyperLink>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </asp:HyperLink>
                        </td>
                    </ItemTemplate>
                </asp:ListView>
            </table>
        </td>
    </tr>
    <tr>
        <td style="padding: 0 10px 10px; text-align: right">
            <asp:DataPager ID="DataPagerImages" runat="server" PagedControlID="lvItems" 
                PageSize="20">
                <Fields>
                    <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="False" ShowNextPageButton="False"
                        ShowPreviousPageButton="False" />
                    <asp:NumericPagerField />
                    <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="False" ShowNextPageButton="False"
                        ShowPreviousPageButton="False" />
                </Fields>
            </asp:DataPager>
        </td>
    </tr>
</table>

<script language="javascript" type="text/javascript">
    function fn_AddToCart(productCodeAndPrice) {
        PageMethods.SetShoppingCartSesstion(productCodeAndPrice, SetShoppingCart);
    }
</script>
